﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Poke_Tactics
{
    public class Camera
    {


        GraphicsDevice graphics;

        /// <summary>
        /// Posição da câmera.
        /// </summary>
        public Vector2 position;

        /// <summary>
        /// Rotação da câmera.
        /// </summary>
        public float rotation;

        /// <summary>
        /// Zoom da câmera.
        /// </summary>
        public float zoom;

        //Matriz transform. Usada no draw.
        public Matrix transformMatrix1
        {
            get
            {
                return Matrix.CreateRotationZ(rotation) * Matrix.CreateScale(zoom) *
                       Matrix.CreateTranslation(position.X, position.Y, 0);
            }
        }

        public Matrix transformMatrix
        {
            get
            {
                return
                Matrix.CreateTranslation(new Vector3(-position.X, -position.Y, 0)) *
                                         Matrix.CreateRotationZ(rotation) *
                                         Matrix.CreateScale(new Vector3(zoom, zoom, 1)) *
                                         Matrix.CreateTranslation(new Vector3(graphics.Viewport.Width * 0.5f, graphics.Viewport.Height * 0.5f, 0));
            }
        }

        
        public Camera(GraphicsDevice graphics)
        {
            this.graphics = graphics;
            position = Vector2.Zero;
            zoom = 1f;
        }



    }
}
